<template>
  <div>
    <a @click="goToBaidu" href="http://www.baidu.com">阻止去百度</a>
    <hr>
    <a @click="goToBaidu1(10,$event)" href="http://www.baidu.com">阻止去百度</a>
  </div>
</template>

<script>
export default {
  name: 'CodeApp',

  data() {
    return {
      
    };
  },

  mounted() {
    
  },

  methods: {
    goToBaidu(e){
      e.preventDefault();
    },
    goToBaidu1(num,e){
      console.log(num);
      e.preventDefault();
    }
  },
};
</script>

<style lang="scss" scoped>

</style>